<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('焊接周期分析列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
<!--                            <li>-->
<!--                                <label>产品id：</label>-->
<!--                                <input type="text" name="productId"/>-->
<!--                            </li>-->
                            <li>
                                <label>产品名称：</label>
                                <input type="text" name="productName"/>
                            </li>
                            <li>
                                <label>焊缝名称：</label>
                                <input type="text" name="weldLineName"/>
                            </li>
                            <li>
                                <label>焊工姓名：</label>
                                <input type="text" name="welderName"/>
                            </li>
<!--                            <li>-->
<!--                                <label>焊接开始时间：</label>-->
<!--                                <input type="text" name="weldStartTime"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>焊接完成时间：</label>-->
<!--                                <input type="text" name="weldEndTime"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>产品焊接时间：</label>-->
<!--                                <input type="text" name="weldTime"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>预留1：</label>-->
<!--                                <input type="text" name="spare1"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>预留2：</label>-->
<!--                                <input type="text" name="spare2"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>预留3：</label>-->
<!--                                <input type="text" name="spare3"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>预留4：</label>-->
<!--                                <input type="text" name="spare4"/>-->
<!--                            </li>-->
<!--                            <li>-->
<!--                                <label>预留5：</label>-->
<!--                                <input type="text" name="spare5"/>-->
<!--                            </li>-->
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;刷新</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
<!--                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="analysis:cycle:add">-->
<!--                    <i class="fa fa-plus"></i> 添加-->
<!--                </a>-->
<!--                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="analysis:cycle:edit">-->
<!--                    <i class="fa fa-edit"></i> 修改-->
<!--                </a>-->
<!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="analysis:cycle:remove">-->
<!--                    <i class="fa fa-remove"></i> 删除-->
<!--                </a>-->
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="analysis:cycle:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('analysis:cycle:edit')}]];
        var removeFlag = [[${@permission.hasPermi('analysis:cycle:remove')}]];
        var prefix = ctx + "analysis/cycle";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "焊接周期分析",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '编号',
                    visible: false
                },
                {
                    field: 'productId',
                    title: '工序编码'
                },
                {
                    field: 'productName',
                    title: '焊缝编码'
                },
                {
                    field: 'weldLineName',
                    title: '焊缝名称'
                },
                {
                    field: 'welderName',
                    title: '焊工姓名'
                },
                {
                    field: 'weldStartTime',
                    title: '焊接开始时间'
                },
                {
                    field: 'weldEndTime',
                    title: '焊接完成时间'
                },
                {
                    field: 'weldTime',
                    title: '产品焊接时间'
                },
                {
                    field: 'spare1',
                    title: '暂停次数',
                    formatter: function (value, row, index)
                    {
                        if (value === "0") { return "<strong><font color=\"green\">" + value+"</font></strong>"; }
                        else {return "<strong><font color=\"red\">" + value+"</font></strong>";}
                    }
                },
                {
                    field: 'spare2',
                    title: '暂停时间',
                    formatter: function (value, row, index)
                    {
                        return "<strong><font color=\"red\">" + value+"</font></strong>";
                    }
                },
                // {
                //     field: 'spare3',
                //     title: '预留3'
                // },
                // {
                //     field: 'spare4',
                //     title: '预留4'
                // },
                // {
                //     field: 'spare5',
                //     title: '预留5'
                // },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>